<?php
$server="localhost";
$name="root";
$pwd="root";
$db="aynak";

$con=mysqli_connect($server,$name,$pwd,$db);
if($con){
    $id=$_GET['id'];
    $sql="select from aynakk upload where id=" .$id;
    $run=mysqli_query($con,$sql);
    if ($run && mssql_num_rows($run)>0){
        $kur = mysqli_fetch_assoc($run);
        $yuyux = unlink($kur['img']);
        if ($yuyux){
        }
        echo "头像删除成功 <br>";
        $sql= "delete from upload where id=" .$id;
        $run= mysqli_query($con,$sql);
        if ($run){
            echo "删除这条记录成功";
        }

    }else{
        echo "删除失败" .mysqli_connect_error();
    }


}
